//Jen Anderson
//CS 362
//Assignment 3
//cardtest1.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dominion.h"


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dominion.h"

// set NOISY_TEST to 0 to remove printfs from output
#define NOISY_TEST 1

void testSmithy()
{
	//Declare variables necessary for a game
        int k[10] = {adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall};
        struct gameState *game = newGame();

	//Initialize a new game and new game state
        initializeGame(3, k, 10, game);
        struct gameState *testGameState = malloc(sizeof(struct gameState));
	memcpy(testGameState, game, sizeof(struct gameState));

        int coin = 0;
        cardEffect(smithy, 0, 0, 0, testGameState, 0, &coin);

	#if(NOISY_TEST == 1)
        	if(testGameState->handCount[testGameState->whoseTurn] == game->handCount[testGameState->whoseTurn]+2)
                	printf("smithy: PASS Cards Drawn\n");
        	else
                	printf("smithy: FAIL Cards Not Drawn\n");
	#endif       
 
	#if(NOISY_TEST == 1)
		if(testGameState->numBuys == game->numBuys)
               		printf("smithy: PASS buys not effected\n");
        	else
                	printf("smithy: FAIL buys shouldn't be changed\n");
	#endif                

	#if(NOISY_TEST == 1)
        	if(testGameState->numActions == game->numActions)
               		printf("smithy: PASS No Actions Added\n");
        	else
                	printf("smithy: FAIL No Actions Added\n");      
	#endif
	printf("cardtest1 completed with no fatal errors\n");
}

int main(int argc, char *argv[]){
    testSmithy();
    return 0;
}
